<template>
	<view class="fc">
		<image class="ib" :class="className" :style="[emptyStyle]" :src="emptyUrl" mode=""></image>
		<view class="mt_25 fc_999">
			{{emptyText}}
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			type: {
				type: String,
				default: 'record'
			},
			size: {
				type: String | Number,
				default: '123'
			},
			title: {
				type: String,
				default: ''
			},
		},
		computed: {
			emptyUrl() {
				switch (this.type) {
					case 'record':
						return this.$ossUrl+'/record_empty.png';
					case 'search':
						return this.$ossUrl+'/search_empty.png';
					case 'address':
						return this.$ossUrl+'/address_empty.png';
					case 'logistics':
						return this.$ossUrl+'/address_empty.png';
					case 'logout':
						return this.$ossUrl+'/shoppingcart_empty.png';
					default:
						return this.$ossUrl+'/record_empty.png';
				}
			},
			emptyText() {
				if (this.title) return this.title
				switch (this.type) {
					case 'bargainRecord':
						return '暂无砍价记录';
					case 'record':
						return '暂无记录';
					case 'search':
						return '暂未搜索到该商品';
					case 'address':
						return '暂无添加地址~';
					case 'logistics':
						return '暂无物流公司~';
					case 'logout':
						return '请登录后查看购物车商品！';
					default:
						return '暂无记录';
				}
			},
			className() {
				return `width_${this.size} height_${this.size}`
			},
			emptyStyle() {
				console.log(999)
				return this.type == 'logout' ? {'margin-top': '256rpx'}:{}
			}
		}
	}
</script>

<style>
</style>